package db.util;

import java.io.FileReader;
import java.io.FileWriter;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class XmlIO {
	static XStream xstream = new XStream(new DomDriver());
	public static void main(String[] args) {
		
	}
	public static String toXML(DbStructure dbs) {
		return xstream.toXML(dbs);
	}
	public static DbStructure fromXML(String xml) {
		return (DbStructure) xstream.fromXML(xml);
	}
	public static void toXML(DbStructure dbs, FileWriter os) {
		xstream.toXML(dbs, os);
	}
	public static DbStructure fromXML(FileReader is) {
		return (DbStructure) xstream.fromXML(is);
	}
}
